home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 15120 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.2 KB

  1. Path: news.acadia.net!usenet
  2. From: Nickii Sonnenberg <nickii@aerohydro.com>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Derived Class Woes
  5. Date: Wed, 03 Apr 1996 15:06:28 -0400
  6. Organization: AeroHydro
  7. Message-ID: <3162CC34.231B@aerohydro.com>
  8. References: <paulg53-0104960929470001@paulg53.escape.com>
  9. NNTP-Posting-Host: bhb25.acadia.net
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win95; I)
  14.  
  15. Paul A. Gusmorino wrote:
  16. > I'm having trouble with some code I'm writing. All the class and member
  17. > function names have been changed to protect the innocent, but the prblem
  18. > is real :-) I have a class, let's call it TApp. TApp has two member
  19. > functions Run and DoSomething. Run is just a big loop that keeps calling
  20. > DoSomething until the user quits. I've derived a class from TApp called
  21. > MyApp. In MyApp I've written a new DoSomething. My problem is that when I
  22. > call MyApp's Run (which was inherited from TApp), then it calls TApp's Run
  23. > and NOT MyApp's Run. Is there a way to solve the problem?
  24. > Thanks a million,
  25. > Paul A. Gusmorino 3rd <paulg53@escape.com>
  26.  
  27. Did you write the TApp class? If so, you need to make the DoSomething 
  28. virtual.
  29.